<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Home extends MY_Controller {

    var $_templates = array();
    var $_lang = '';

    function __construct() {
        parent::__construct();
        if (!$this->logged_in()) {
            $this->session->set_userdata("redirect", base_url("home"));
        }

        $this->session->set_userdata(array('Url' => uri_string()));
        $this->_lang = $this->lang->lang();
        $this->load->model('product_category_model', 'product_category');
        $this->load->model('product_model', 'product');
        $this->load->model('partner_model', 'partner');
        $this->load->model('banners_model', 'banners');
    }

    public function index() {
        $this->data['categoryHome'] = $this->product_category->getMenuCategoryHome();
        $this->data['productHome'] = $this->product->getProduct(array(), 0, 20);
        $this->data['productPartners'] = $this->partner->getPartners(array(), 0, 20);
        $this->data['bannerHome'] = $this->banners->get_from_group(1);
        $this->data['bannerSmallHome'] = $this->banners->get_from_group(5);
        $this->data['pageTitle'] = "Trung tâm phân phối thời trang chính hãng cao cấp tại Việt Nam >> ngoinhabeyeu.com";
        $this->_templates['page'] = 'home/home_view';
        $this->site_lib->load($this->_templates['page'], $this->data);
    }

}

/* End of file home.php */
/* Location: ./application/controllers/home.php */